package com.sudo.service.admin.service;

import com.sudo.dao.admin.entity.SysUserBehavior;
import com.sudo.dao.admin.model.dto.OnlineUserDTO;
import com.sudo.dao.admin.model.vo.SysSimpleRoleButtonVO;

import java.util.List;
import java.util.Set;

/**
 * @Author：DayDayUp
 * @Create：2023/3/22 10:23
 */
public interface SysRedisAuthService {
    void setRedisUserBehavior(SysUserBehavior sysUserBehavior);

    String getRedisUserBehavior();

    void setRedisUserExpire(String username);

    String getRedisUserTokenString(String username);

    OnlineUserDTO getRedisUserToken(String username);

    Set<String> getRedisUserTokenKey(String username);

    void setRedisUserToken(String username, OnlineUserDTO onlineUserDTO);

    void delRedisUserToken(String username);

    void setRedisRoleStatus(String roleCode, String status);

    String getRedisRoleStatus(String roleCode);

    void delRedisRoleStatus(String roleCode);

    void setRedisMenuButtonToRedis(String menuCode, String buttonCode);

    void delRedisMenuButtonFromRedis(String menuCode, String buttonCode);

    void setRedisRolePermissionToRedis(String roleCode, String menuCode, String buttonCode);

    void setRedisRolePermissionToRedis(List<SysSimpleRoleButtonVO> sysSimpleRoleButtonVOList);

    void delRedisRolePermissionFromRedis(String roleCode, String menuCode, String buttonCode);

    Set<String> getRedisAuthButton(String roleCode, String menuCode);

    Set<String> getRedisMenuButton(String menuCode);

    boolean hasRoleMenuButton(String roleCode, String menuCode, String buttonCode);

    void onLoadAllRoleMenuButtonAuth(String roleCode, String menuCode);

    void onLoadMenuButtonToRedis(String menuCode);

    void setSysCpuLogByRealTime(String server, String value);

    void setSysMemLogByRealTime(String server, String value);

    void setSysCpuMemInfoByRealTime(String server, String value);

    String getRedisCpuLog(String serverNode);

    String getRedisMemLog(String serverNode);

    List<String> getRedisCpuLogRealTime(String serverNode);

    List<String> getRedisMemLogRealTime(String serverNode);

    void setRedisMemCpuRealTime(String serverNode, String data);

    List<String> getRedisMemCpuRealTime(String serverNode, int num);

    void onLoadAllRoleStatus();
}
